package com.gzx.plugin.tjzy.core.caffeine;

import com.github.benmanes.caffeine.cache.Cache;
import com.github.benmanes.caffeine.cache.Caffeine;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.TimeUnit;

/**
 * @author zjt
 * @description
 * @date 2025/5/21 14:39
 */
@Configuration
public class TjzyCaffeineConfig {

    /**
     * 通话缓存
     *
     * @return
     */
    @Bean
    public Cache<String, String> callUserCache() {
        return Caffeine.newBuilder()
                .maximumSize(5000)
                .initialCapacity(200)
                .expireAfterWrite(1, TimeUnit.HOURS)
                .build();
    }
}